import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)
// 跳转非bar
Vue.prototype.jumpTo = function(url, params) {
  if (isBoj(params)) {
    url += '?'
    for (const key in params) {
      url += `${key}=${params[key]}&`
    }
    url = url.substr(0, url.length - 1)
  }
  uni.navigateTo({
    url
  })
}
Vue.prototype.time = function(timestamp) {

  const date = new Date(timestamp*1000);
  const year = date.getFullYear();
  const month = date.getMonth() + 1; //月份是从0开始的，所以要加1
  const day = date.getDate();
   
  const result = year + '/' + month + '/' + day;
	return result
}

Vue.prototype.jumpToR = function(url, params) {
  if (isBoj(params)) {
    url += '?'
    for (const key in params) {
      url += `${key}=${params[key]}&`
    }
    url = url.substr(0, url.length - 1)
  }
  uni.redirectTo({
    url
  })
}
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif